<?php
require("../../../class2.php");
require("../library/admin/adminapi.php");

if(!getperms("P")){header("location:".e_BASE."index.php"); exit; }
require_once(e_ADMIN."auth.php");

global $e107shop_db_name, $sql, $ns;
// First check if an attribute must be deleted
if($_GET["a"]==2) {
        $sql->db_Delete($e107shop_db_name['product_options'], "ID=".$_GET["p"]);
        $ns->tablerender("<center>".lan_global_status."</center>", 
        "<center><br />".lan_global_deleted."</center>");
}
// Process the Form
if($_POST["subbed"])
{
    e107shop_process_attribute($_POST["faction"], $_POST["option_name"], $_POST["option_value"], 
    $_POST["option_group"], $_POST["operator"], $_POST["product"], $_POST["attributeid"]);
}

//
// Display the list of products
//
e107shop_product_list_attributes($_GET["g"]);

//
// Display the form
//
e107shop_manage_attributes($_GET["a"], $_GET["p"]);

require_once(e_ADMIN."footer.php");
